package org.hhh.basic.util;

import lombok.Data;

@Data
public class AjaxResult {

    private boolean success=true;
    private String message="操作成功";
    private Object resultObj;//封装额外的返回参数

    /**
     * 内部创建好对象(静态方法)
     */
    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**
     * 链式编程设置完成对象自己返回
     * @param success
     */
    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;

    }
}
